package org.eclipse.assemblyformatter.parsers;

import org.eclipse.assemblyformatter.ir.Section;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;

/**
 * Base class for parsers.
 * 
 * A parser is traversing the linked list of document sections and replaces some
 * low-level sections with high-level sections.
 * 
 */
public abstract class Parser {
	protected IDocument document;

	public IDocument getDocument() {
		return document;
	}

	public void setDocument(IDocument document) {
		this.document = document;
	}

	protected Section base; // The base of the linked list of document sections

	public Section getBase() {
		return base;
	}

	public void setBase(Section base) {
		this.base = base;
	}

	public abstract void run() throws BadLocationException;
}
